The present invention related to an image information encoding/decoding device for carrying out encoding and decoding in accordance with the MH system, MR system or MMR system that are international standard systems, and more particularly to an image information encoding/decoding device for carrying out two-dimensional encoding and decoding by switching the control mode and the data paths of a single circuit.
Image-information-handling devices such as facsimile equipment and an image filing device usually employ some kind of encoding to carry out efficient transmission or storage of image information. In connection with this, there have been known many encoding/decoding systems. In particular, as international standard systems, there are specified the MH system and the MR system by CCITT Report T4 and there is specified the MMR encoding system by CCITT Report T6.
In carrying out encoding and decoding in accordance with the above-mentioned international standard systems, if the transmission speed of encoded information of the image information encoding/decoding device is relatively small to a degree of telephone lines, as in facsimile equipment, there will occur no particular difficulty even when software processing is carried out by the use of a microcomputer. However, in devices such as an image filing device that require high-speed processing, it becomes necessary to construct a part or the entirety of a encoding and a decoding device with hardware dedicated to that purpose. An example of such a device is the encoding device disclosed in Japanese Patent Application Laid-Open No. 122282/1984 whose block diagram is shown in FIG. 14.
Before moving to describe the operation of the prior art encoding device shown in FIG. 14, a description of "mode information" is in order. In the MR and MMR systems, shift points (picture elements at which a change from white to black or vice versa occurs) in binary image information of a scanning line currently under processing (referred to as encoding line in the case of encoding and decoding line in the case of decoding hereinafter) and shift points in binery image information of a reference line whose encoding or decoding has already been completed, are detected and compared with each other. Encoding and decoding are carried out taking into account which one of a vertical mode, horizontal mode and pass mode of operation is applicable to the relation between these two kinds of binary image information. That the reference line is normally a scanning line which has already been encoded or decoded and is adjacent to a current scanning line.
The above-mentioned three operation modes will now be described by making reference to FIG. 13. It is to be noted that encoding or decoding proceeds from left to right in the figure.
Suppose that a shift point which will serve as a starting point on an encoding line is called a.sub.0, a first shift point to the right of the shift point a.sub.0 on the encoding line is defined as a.sub.1, a first shift point to the right of a.sub.1 on the encoding line is defined as a.sub.2, a shift point on a reference line to the right of a.sub.0 and being the first to have color information opposite to that of a.sub.0 is defined as a reference point b.sub.1, and a first shift point to the right of b.sub.1 on the reference line is defined as a reference point b.sub.2. If the reference point b.sub.2 finds itself to the left of the shift point a.sub.l as is the case shown in FIG. 13(a), the situation is called a pass mode P. In this case, since the information on the reference line cannot be utilized for data compression, in order to carry out encoding in the vertical or horizontal mode, addresses of the shift points are changed so as to be associated with the symbols with a prime mark attached, as shown in FIG. 13(a). In this case, the address of new a.sub.0 is given the address of b.sub.2 prior to the change.
When the distance between the shift point a.sub.1 and the reference point b.sub.1 is equal to or smaller than 3 picture elements, that is .vertline.a.sub.1 b.sub.1 .vertline..ltoreq.3, as shown in FIG. 13(b), the situation is called a vertical mode V. Based on the judgment on the relative distance between the point a.sub.1 and b.sub.1, and whether a.sub.1 is on the right hand side or on the left-hand side of b.sub.1, one of following code words is generated. First, when a.sub.1 is directly below b.sub.1, namely .vertline.a.sub.1 b.sub.1 .vertline.=0, a code word V(0) is generated, and when a.sub.1 is on the right-hand side of b.sub.1 and .vertline.a.sub.1 b.sub.1 .vertline.=1, .vertline.a.sub.1 b.sub.1 .vertline.=2 or .vertline.a.sub.1 b.sub.1 .vertline.=3, a code word VR(1), VR(2) or VR(3) is generated, respectively. Similarly, when a.sub.1 is on the left-hand side of b.sub.1 and there holds .vertline.a.sub.1 b.sub.1 .vertline.=1, .vertline.a.sub.1 b.sub.1 .vertline.=2 or .vertline.a.sub.1 b.sub.1 .vertline.=3, a code word VL(1), VL(2) or VL(3) is generated, respectively. In other words, when .vertline.a.sub.1 b.sub.1 .vertline..ltoreq.3 holds, it is judged that there exists a vertical correlation and the boundary deviation of the current scanning line from the reference line is encoded.
When .vertline.a.sub.1 b.sub.1 .vertline.&gt;3 holds, the situation is called a horizontal mode H, and based on the relative distances between a.sub.0 and a.sub.1, and a.sub.1 and a.sub.2, code words are generated in accordance with an one-dimensional encoding system. Namely, when .vertline.a.sub.1 b.sub.1 .vertline.&gt;3, it is regarded that there is no vertical correlation, one-dimensional encoding, instead of two-dimensional encoding, is carried out, and a code word consisting of two run-length data and a symbol "H" attached at the head and indicating the horizontal mode is output.
Further, according to the specifications of the aforementioned Reports, the vertical mode is allowed to have at most .+-.3 picture elements as the deviation between a.sub.1 and b.sub.1, so that when an encoding pertaining to a certain shift point has been completed and the next encoding is about to start, there sometimes occurs a so-called retrogression of the reference point in which b.sub.1 is moved to the left side of its former position. For instance, if an encoding has been carried out under the condition that the shift points are located as shown in FIG. 13(c) (without primes), the shift points for the next encoding should be, by definition, located at the positions with the primes on the respective symbols, where the position of b.sub.1 is moved to occupy a position to the left of its former position. This is what is called the retrogression of the reference point.
It should be noted in the above description that the symbol .vertline.a.sub.1 b.sub.1 .vertline. means the absolute value of the difference between the address of the point a.sub.1 and the address of the point b.sub.1. This notation will be used also in what follows.
Now, the construction of the two-dimensional encoding device shown in Japanese Patent Application Laid-Open No. 122282/1984 mentioned above is as given in FIG. 14, and its operation is roughly as follows. Run-length data of an encoding scanning line and a reference scanning line are sequentially written in and read from an encoding scanning line memory 131 and a reference scanning line memory 132, respectively. A gate logic 133 computes addresses of the shift points a.sub.0, a.sub.1, a.sub.2, b.sub.1 and b.sub.2 by sequentially adding run-length data that are read from the memories 131 and 132, and stores them in registers 135, 136, 137, 138 and 139, respectively. A feature judging logic 140 judges the current mode from the relative positions of the shift-point addresses, and outputs the mode data. The mode data is sent through a mode buffer 141 to an output logic 142 where it is converted to the cord word to be output. A drive sequencer 134 executes the control of each circuit.
Further, in Japanese Patent Application Laid-Open No. 190779/1984, there is also mentioned to carry out two-dimensional encoding while making reference to run-length information of a reference line that is stored in a run-length buffer memory.
In order to recover the original form from encoded image information it is necessary to carry out decoding processing. As such a counterpart decoding device to the two-dimensional encoding, there has been known Japanese Patent Application Laid-Open, No. 133778/1986, which intends to carry out decoding processing by providing a buffer memory for temporarily storing run-length data, and using software executed by a microprocessor
Moreover, the present inventor proposed previously an image information encoding/decoding device for carrying out encoding and decoding processings at high speed and with small circuit scale by switching the control mode and the data paths of a common circuit (see Japanese Patent Application Laid-Open No. 25672/1989).
In the encoding device shown in FIG. 14, however, there are such problems as will be described below. Namely, it is necessary to carry out mode judging when a previous encoding has been completed and the next encoding is to be started. For that purpose, until establishing connection between the registers 135-139 and the encoding scanning line memory 131 and the reference scanning line memory 132 corresponding to the previous encoding mode, contents of the registers 135-139 should not be updated. This gives rise to a problem that the control required is complicated and that the processing takes a long time. To be more specific, when the previous encoding mode was the vertical mode V, the following procedure must follow: first the contents of the register 136 are stored in the register 135 by connecting those registers, then the contents of the register 137 are stored in the register 136 by connecting those registers, next, the contents of the register 137 and the run-length information stored in the encoding scanning line memory 131 are added by connecting them through the gate logic 133, and finally the result of addition is stored in the register 137. Further, when the previous encoding mode was the pass mode P, the contents of the register 139 is stored in the register 135 by connecting those registers. The contents of the registers 138 and 139 are updated in accordance with the definition of the reference point b.sub.1 after the register 135 has been updated.
As described above, the image information encoding/decoding device shown in FIG. 14 takes a long time to update the contents of the registeres, which processing is required for the next encoding.
Although, in Japanese Patent Application Laid-Open No. 190779/1984, there appears a passage describing execution of the two-dimensional encoding by making reference to run-length information of a reference line stored in a run-length data buffer memory, no specific constitution is revealed therein.
The situation is similar for the decoding device. In Japanese Patent Application Laid-Open No. 133778/1986, there is no description about a specific constitution for obtaining run-length information of a decoding line from run-length information of a reference line stored in a run-length data buffer memory and mode information.
Moreover, Japanese Patent Application Laid-Open No. 25672/1989 proposed by the present inventor relates mainly to the MH encoding system, namely, one-dimensional encoding system. Although it gives an example in which the invention is applied to the two-dimensional encoding system such as the MR encoding system, it is required to separately provide a means for detecting mode information in the case of two-dimensional encoding, and a means for detecting run-length information in the case of two-dimensional decoding. Therefore, there is a problem that the scale of circuit becomes large.